package com.imut.lagain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;

import java.time.LocalDateTime;

/**
 * 心情记录实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("mood_record")
public class MoodRecord {
    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空")
    @TableField("user_id")
    private Long userId;
    
    /**
     * 心情类型 (happy, sad, excited, calm, anxious, angry, love, grateful)
     */
    @NotNull(message = "心情类型不能为空")
    @TableField("mood_type")
    private String moodType;
    
    /**
     * 心情强度 (1-10)
     */
    @NotNull(message = "心情强度不能为空")
    @Min(value = 1, message = "心情强度最小为1")
    @Max(value = 10, message = "心情强度最大为10")
    @TableField("intensity")
    private Integer intensity;
    
    /**
     * 心情描述
     */
    @TableField("description")
    private String description;
    
    /**
     * 心情标签 (JSON格式存储多个标签)
     */
    @TableField("tags")
    private String tags;
    
    /**
     * 触发事件
     */
    @TableField("trigger_event")
    private String triggerEvent;
    
    /**
     * 地点
     */
    @TableField("location")
    private String location;
    
    /**
     * 天气
     */
    @TableField("weather")
    private String weather;
    
    /**
     * 是否与伴侣分享
     */
    @TableField("shared_with_partner")
    private Boolean sharedWithPartner = false;
    
    /**
     * 记录时间
     */
    @TableField("record_time")
    private LocalDateTime recordTime;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    /**
     * 是否删除
     */
    @TableField("is_deleted")
    @TableLogic
    private Boolean isDeleted = false;
}